#include <iostream>
using namespace std;

// 已知
int n;
// 未知
int a[111111];

int main()
{
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        cin >> a[i];
        if (i > 0 and a[i] <= a[i - 1])
        {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}